﻿using ModuleBase;
using Prism.Ioc;

namespace BasicJudgment
{
    public class BasicJudgment : ModuleBase.ModuleBase
    {
        bool outputs = false;
        public BasicJudgment(IAxisCardService axisCardService, IContainerProvider containerProvider)
        {
            Name = "判断";
        }

        public override bool Execute(ModuleBase.ExecutionContext context)
        {
            Status = ModuleStatus.Executing; // 设置状态为执行中

            if ((bool)input["Input"] == true)
            {
                outputs = true;
                outputs = false;
            }
            else
            {
                outputs = false;
                outputs = true;
            }

            return outputs;
        }

        public override async Task<bool> ExecuteAsync(ModuleBase.ExecutionContext context)
        {
            
            outputs.Add("Output1", false);
            outputs.Add("Output2", false);
            var result = await Task.Run(() => Execute(context));
            return result;
        }

        public override void Initialize()
        {

        }
    }
}
